<template>
  <div style="width:100vw;" class="home">
    <div class="home-body">
      <div class="bscroll" ref="bscroll">
        <div class="bscroll-container">
          <div class="menu-box colum-flex">
            <ul style="flex-wrap:wrap;" class="item-box row-flex">
              <li @click="setParams(items.name)" v-for="items in list" :key="items.id" v-show="items.id != 6" class="item">
                <div class="colum-flex">
                  <span :style="{backgroundColor:items.bgcolor}" class="picture-box menu-size">
                    <img :src="require('@/assets/homePicture/'+items.picture+'.png')" />
                  </span>
                  <span>{{items.text}}</span>
                </div>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { setText } from "../../untils/ddnavigate";
import { Indicator, Toast } from "mint-ui";
export default {
  name: "Home",
  data() {
    return {
      list: [
        {
          id: 1,
          picture: "menu-hat",
          text: "优才引荐",
          bgcolor: "#4BDBFF",
          name: "talentIntroduce"
        },
        {
          id: 2,
          picture: "menu-email",
          text: "成长档案",
          bgcolor: "#FF535A",
          name: "growup"
        },
        {
          id: 3,
          picture: "menu-book",
          text: "学习中心",
          bgcolor: "#FD9535",
          name: "studyCenter"
        },
        {
          id: 4,
          picture: "menu-date",
          text: "办事指南",
          bgcolor: "#9F8FBC",
          name: "things"
        },
        {
          id: 5,
          picture: "menu-men",
          text: "人事制度",
          bgcolor: "#FFCB41",
          name: "peopleRules"
        },
        {
          id: 6,
          picture: "menu-up",
          text: "薪酬绩效",
          bgcolor: "#FF5799",
          name: "thingss"
        },
        {
          id: 7,
          picture: "menu-callmen",
          text: "课程中心",
          bgcolor: "#2B84CF",
          name: "classCenter"
        }
      ]
    };
  },
  mounted() {
    let roles = JSON.parse(localStorage.getItem("role"));
    if (roles) {
      this.roles = roles.points;
    } else {
      console.warn("获取权限失败");
    }
    setText("更多服务");
  },
  methods: {
    setParams(e) {
      if (e == "thingss") {
        Toast({
          className: "z-index",
          message: "敬请期待",
          duration: 2000
        });
        return;
      }
      this.$router.push({ path: e });
      // this.$store.commit("setRouterName", e);
    }
  }
};
</script>
<style lang="less" scoped>
@import url("~@/pagecss/home.less");
</style>

